import request from '@/utils/request'

// 查询资源列表
export function listStudyRes(query) {
  return request({
    url: '/study/studyRes/list',
    method: 'get',
    params: query
  })
}

// 更新资源浏览次数
export function incResView(id) {
  return request({
    url: '/study/studyRes/inc/' + id,
    method: 'get'
  })
}


// 查询资源详细
export function getStudyRes(id) {
  return request({
    url: '/study/studyRes/' + id,
    method: 'get'
  })
}

// 新增资源
export function addStudyRes(data) {
  return request({
    url: '/study/studyRes',
    method: 'post',
    data: data
  })
}

// 修改资源
export function updateStudyRes(data) {
  return request({
    url: '/study/studyRes',
    method: 'put',
    data: data
  })
}

// 删除资源
export function delStudyRes(id) {
  return request({
    url: '/study/studyRes/' + id,
    method: 'delete'
  })
}

// 导出资源
export function exportStudyRes(query) {
  return request({
    url: '/study/studyRes/export',
    method: 'get',
    params: query
  })
}